/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.core.treeeditpart;

import java.beans.PropertyChangeListener;

import com.cea.papyrus.core.editor.ModelManager;

/**
 * 
 * 
 * @author Patrick Tessier
 * 21 juin 06
 */

public class GeneralizationTreeEditPart extends ElementTreeEditPart
implements PropertyChangeListener {
	

	/**
	 * Create a new instance of this edit part using the given model element.
	 * 
	 * @param modelManager 
	 * @param model a non-null ShapesDiagram instance
	 */
	public GeneralizationTreeEditPart(org.eclipse.uml2.uml.Generalization model,ModelManager modelManager) {
		super(model,modelManager);
		
	}

	/*
	 * (non-Javadoc)
	 * @see com.cea.papyrus.Newtree.NamedElementTreeEditPart#getText()
	 */
	 /**
	 * 
	 * 
	 * @return 
	 */
	@Override
	public String getText() {
			String label = "";
			String superclass = "unknown";
			
			if (getGeneralization().getGeneral() != null) {
				superclass = getGeneralization().getGeneral().getName();			
			}
			
			label = "is a"+superclass;
			
			return label;
	 }

/**
 * 
 * 
 * @return the dependency that is linked to this editPart
 */
	public org.eclipse.uml2.uml.Generalization getGeneralization(){
		return (org.eclipse.uml2.uml.Generalization)element;
	}
		
}